package com.huawei.esdk.tp.professional.local.impl.service;

import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.xml.datatype.Duration;

import org.apache.cxf.common.util.StringUtils;
import org.apache.log4j.Logger;

import com.huawei.esdk.platform.professional.local.constant.PlatformNativeConstant;
import com.huawei.esdk.tp.professional.local.bean.AddSiteToConfEx;
import com.huawei.esdk.tp.professional.local.bean.AddSiteToConfExResponse;
import com.huawei.esdk.tp.professional.local.bean.AdhocConfFreeBusyStateEx;
import com.huawei.esdk.tp.professional.local.bean.AdhocConferenceEx;
import com.huawei.esdk.tp.professional.local.bean.ConferenceInfoEx;
import com.huawei.esdk.tp.professional.local.bean.ConferenceStatusEx;
import com.huawei.esdk.tp.professional.local.bean.ConnectSitesEx;
import com.huawei.esdk.tp.professional.local.bean.DelScheduledConfEx;
import com.huawei.esdk.tp.professional.local.bean.DelSiteFromConfEx;
import com.huawei.esdk.tp.professional.local.bean.DisconnectSitesEx;
import com.huawei.esdk.tp.professional.local.bean.DisplayConfSiteLocalVideoEx;
import com.huawei.esdk.tp.professional.local.bean.DisplayConfSiteLocalVideoExResponse;
import com.huawei.esdk.tp.professional.local.bean.EditRecurrenceConferenceEx;
import com.huawei.esdk.tp.professional.local.bean.EditRecurrenceConferenceExResponse;
import com.huawei.esdk.tp.professional.local.bean.EditScheduledConfEx;
import com.huawei.esdk.tp.professional.local.bean.EditScheduledConfExResponse;
import com.huawei.esdk.tp.professional.local.bean.FreeBusyStateEx;
import com.huawei.esdk.tp.professional.local.bean.GetContinuousPresenceInfoEx;
import com.huawei.esdk.tp.professional.local.bean.GetContinuousPresenceInfoExResponse;
import com.huawei.esdk.tp.professional.local.bean.GetContinuousPresenceInfoExResult;
import com.huawei.esdk.tp.professional.local.bean.GetContinuousPresenceParamEx;
import com.huawei.esdk.tp.professional.local.bean.GetContinuousPresenceParamExResponse;
import com.huawei.esdk.tp.professional.local.bean.GetContinuousPresenceParamExResult;
import com.huawei.esdk.tp.professional.local.bean.HideConfSiteLocalVideoEx;
import com.huawei.esdk.tp.professional.local.bean.HideConfSiteLocalVideoExResponse;
import com.huawei.esdk.tp.professional.local.bean.LockPresentationEx;
import com.huawei.esdk.tp.professional.local.bean.LockPresentationExResponse;
import com.huawei.esdk.tp.professional.local.bean.MultiPointCDREx;
import com.huawei.esdk.tp.professional.local.bean.MultiPointCDRQueryConfigEx;
import com.huawei.esdk.tp.professional.local.bean.PointToPointCDREx;
import com.huawei.esdk.tp.professional.local.bean.PointToPointCDRQueryConfigEx;
import com.huawei.esdk.tp.professional.local.bean.ProlongScheduledConfEx;
import com.huawei.esdk.tp.professional.local.bean.QueryAdhocConfFreeBusyEx;
import com.huawei.esdk.tp.professional.local.bean.QueryAdhocConfFreeBusyExResponse;
import com.huawei.esdk.tp.professional.local.bean.QueryAdhocConferencesEx;
import com.huawei.esdk.tp.professional.local.bean.QueryAdhocConferencesExResponse;
import com.huawei.esdk.tp.professional.local.bean.QueryConfSiteMCUEx;
import com.huawei.esdk.tp.professional.local.bean.QueryConfSiteMCUExResponse;
import com.huawei.esdk.tp.professional.local.bean.QueryConfSitesStatusEx;
import com.huawei.esdk.tp.professional.local.bean.QueryConfSitesStatusExResponse;
import com.huawei.esdk.tp.professional.local.bean.QueryConferencesStatusEx;
import com.huawei.esdk.tp.professional.local.bean.QueryConferencesStatusExResponse;
import com.huawei.esdk.tp.professional.local.bean.QueryConfigEx;
import com.huawei.esdk.tp.professional.local.bean.QueryMultiPointCDREx;
import com.huawei.esdk.tp.professional.local.bean.QueryMultiPointCDRExResponse;
import com.huawei.esdk.tp.professional.local.bean.QueryPointToPointCDREx;
import com.huawei.esdk.tp.professional.local.bean.QueryPointToPointCDRExResponse;
import com.huawei.esdk.tp.professional.local.bean.QuerySiteStatusEx;
import com.huawei.esdk.tp.professional.local.bean.QuerySiteStatusExResponse;
import com.huawei.esdk.tp.professional.local.bean.QuerySitesEx;
import com.huawei.esdk.tp.professional.local.bean.QuerySitesExResponse;
import com.huawei.esdk.tp.professional.local.bean.RecurrenceConfInfoEx;
import com.huawei.esdk.tp.professional.local.bean.ReleaseConfChairEx;
import com.huawei.esdk.tp.professional.local.bean.RequestConfChairEx;
import com.huawei.esdk.tp.professional.local.bean.ScheduleConfEx;
import com.huawei.esdk.tp.professional.local.bean.ScheduleConfExResponse;
import com.huawei.esdk.tp.professional.local.bean.ScheduleRecurrenceConferenceEx;
import com.huawei.esdk.tp.professional.local.bean.ScheduleRecurrenceConferenceExResponse;
import com.huawei.esdk.tp.professional.local.bean.SetAudioSwitchEx;
import com.huawei.esdk.tp.professional.local.bean.SetBroadcastContinuousPresenceEx;
import com.huawei.esdk.tp.professional.local.bean.SetBroadcastSiteEx;
import com.huawei.esdk.tp.professional.local.bean.SetConfSiteVolumeEx;
import com.huawei.esdk.tp.professional.local.bean.SetConfSiteVolumeExResponse;
import com.huawei.esdk.tp.professional.local.bean.SetContinuousPresenceEx;
import com.huawei.esdk.tp.professional.local.bean.SetFloorEx;
import com.huawei.esdk.tp.professional.local.bean.SetFloorExResponse;
import com.huawei.esdk.tp.professional.local.bean.SetSitesMuteEx;
import com.huawei.esdk.tp.professional.local.bean.SetSitesQuietEx;
import com.huawei.esdk.tp.professional.local.bean.SetVideoSourceEx;
import com.huawei.esdk.tp.professional.local.bean.SiteAccessInfoEx;
import com.huawei.esdk.tp.professional.local.bean.SiteFreeBusyStatesEx;
import com.huawei.esdk.tp.professional.local.bean.SiteInfoEx;
import com.huawei.esdk.tp.professional.local.bean.SiteMCUEx;
import com.huawei.esdk.tp.professional.local.bean.SiteStatusEx;
import com.huawei.esdk.tp.professional.local.bean.SiteVolumeEx;
import com.huawei.esdk.tp.professional.local.bean.SynchAdhocConfFreeBusyEx;
import com.huawei.esdk.tp.professional.local.bean.SynchAdhocConfFreeBusyExResponse;
import com.huawei.esdk.tp.professional.local.bean.SynchSiteStatusEx;
import com.huawei.esdk.tp.professional.local.bean.SynchSiteStatusExResponse;
import com.huawei.esdk.tp.professional.local.bean.TPProfessionalConfCtr;
import com.huawei.esdk.tp.professional.local.bean.TPProfessionalConfMgr;
import com.huawei.esdk.tp.professional.local.bean.TPSDKResponseEx;
import com.huawei.esdk.tp.professional.local.bean.TPSDKResponseWithPageEx;
import com.huawei.esdk.tp.professional.local.bean.UnlockPresentationEx;
import com.huawei.esdk.tp.professional.local.bean.UnlockPresentationExResponse;
import com.huawei.esdk.tp.professional.local.conference.ConferenceServiceEx;
import com.huawei.esdk.tp.professional.local.impl.utils.ClientProvider;
import com.huawei.esdk.tp.professional.local.impl.utils.Encrypt;
import com.huawei.esdk.tp.professional.local.impl.utils.ExceptionUtils;

public class ConferenceServiceExImpl implements ConferenceServiceEx
{
    
    /**
     * 日志对象
     */
    private static final Logger LOGGER = Logger.getLogger(ConferenceServiceExImpl.class);
    
    private TPProfessionalConfCtr TPProfessionalConfCtr =
        (TPProfessionalConfCtr)ClientProvider.getClient(TPProfessionalConfCtr.class);
    
    private TPProfessionalConfMgr TPProfessionalConfMgr =
        (TPProfessionalConfMgr)ClientProvider.getClient(TPProfessionalConfMgr.class);
    
    private static ConferenceServiceExImpl instance = null;
    
    public static synchronized ConferenceServiceExImpl getInstance()
    {
        if (null == instance)
        {
            instance = new ConferenceServiceExImpl();
        }
        return instance;
    }
    
    public TPSDKResponseEx<ConferenceInfoEx> scheduleConfEx(ConferenceInfoEx scheduleConf)
    {
        LOGGER.info("scheduleConfEx method start");
        TPSDKResponseEx<ConferenceInfoEx> resp = new TPSDKResponseEx<ConferenceInfoEx>();
        if (null != scheduleConf && !StringUtils.isEmpty(scheduleConf.getPassword()))
        {
            String encrytedPassword;
            try
            {
                // 加密方式向下兼容
                encrytedPassword = Encrypt.getEncryptPwd(scheduleConf.getPassword());
                scheduleConf.setPassword(encrytedPassword);
            }
            catch (Exception e)
            {
                LOGGER.error("encode password error");
                resp.setResultCode(PlatformNativeConstant.SDK_TP_PASSWORD_ENCODE_ERRORCODE);
                return resp;
            }
        }
        
        if (null != scheduleConf && !StringUtils.isEmpty(scheduleConf.getChairmanPassword()))
        {
            String encrytedChairmanPassword;
            try
            {
                // 加密方式向下兼容
                encrytedChairmanPassword = Encrypt.getEncryptPwd(scheduleConf.getChairmanPassword());
                scheduleConf.setChairmanPassword(encrytedChairmanPassword);
            }
            catch (Exception e)
            {
                LOGGER.error("encode ChairmanPassword error");
                resp.setResultCode(PlatformNativeConstant.SDK_TP_PASSWORD_ENCODE_ERRORCODE);
                return resp;
            }
        }
        
        ScheduleConfExResponse scheduleConfExResp;
        ScheduleConfEx scheduleConfEx = new ScheduleConfEx();
        scheduleConfEx.setScheduleConf(scheduleConf);
        try
        {
            scheduleConfExResp = TPProfessionalConfMgr.scheduleConfEx(scheduleConfEx);
        }
        catch (Exception e)
        {
            LOGGER.error("scheduleConfEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = scheduleConfExResp.getResultCode();
        resp.setResult(0 == resultCode ? scheduleConfExResp.getConferenceInfo() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("scheduleConfEx method end");
        return resp;
    }
    
    public TPSDKResponseEx<RecurrenceConfInfoEx> scheduleRecurrenceConferenceEx(RecurrenceConfInfoEx scheduleConf)
    {
        LOGGER.info("scheduleRecurrenceConferenceEx method start");
        TPSDKResponseEx<RecurrenceConfInfoEx> resp = new TPSDKResponseEx<RecurrenceConfInfoEx>();
        if (null != scheduleConf && !StringUtils.isEmpty(scheduleConf.getPassword()))
        {
            String encrytedPassword;
            try
            {
                // 加密方式向下兼容
                encrytedPassword = Encrypt.getEncryptPwd(scheduleConf.getPassword());
                scheduleConf.setPassword(encrytedPassword);
            }
            catch (Exception e)
            {
                LOGGER.error("encode password error");
                resp.setResultCode(PlatformNativeConstant.SDK_TP_PASSWORD_ENCODE_ERRORCODE);
                return resp;
            }
        }
        
        if (null != scheduleConf && !StringUtils.isEmpty(scheduleConf.getChairmanPassword()))
        {
            String encrytedChairmanPassword;
            try
            {
                // 加密方式向下兼容
                encrytedChairmanPassword = Encrypt.getEncryptPwd(scheduleConf.getChairmanPassword());
                scheduleConf.setChairmanPassword(encrytedChairmanPassword);
            }
            catch (Exception e)
            {
                LOGGER.error("encode ChairmanPassword error");
                resp.setResultCode(PlatformNativeConstant.SDK_TP_PASSWORD_ENCODE_ERRORCODE);
                return resp;
            }
        }
        
        ScheduleRecurrenceConferenceEx scheduleRecurrenceConference = new ScheduleRecurrenceConferenceEx();
        ScheduleRecurrenceConferenceExResponse scheduleRecurrenceConferenceResp;
        scheduleRecurrenceConference.setScheduleConf(scheduleConf);
        try
        {
            scheduleRecurrenceConferenceResp =
                TPProfessionalConfMgr.scheduleRecurrenceConferenceEx(scheduleRecurrenceConference);
        }
        catch (Exception e)
        {
            LOGGER.error("scheduleRecurrenceConferenceEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = scheduleRecurrenceConferenceResp.getResultCode();
        resp.setResult(0 == resultCode ? scheduleRecurrenceConferenceResp.getRecurrenceConfInfo() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("scheduleRecurrenceConferenceEx method end");
        return resp;
    }
    
    public TPSDKResponseEx<ConferenceInfoEx> editScheduledConfEx(ConferenceInfoEx editConf)
    {
        LOGGER.info("editScheduledConfEx method start");
        TPSDKResponseEx<ConferenceInfoEx> resp = new TPSDKResponseEx<ConferenceInfoEx>();
        if (null != editConf && !StringUtils.isEmpty(editConf.getPassword()))
        {
            String encrytedPassword;
            try
            {
                // 加密方式向下兼容
                encrytedPassword = Encrypt.getEncryptPwd(editConf.getPassword());
                editConf.setPassword(encrytedPassword);
            }
            catch (Exception e)
            {
                LOGGER.error("encode password error");
                resp.setResultCode(PlatformNativeConstant.SDK_TP_PASSWORD_ENCODE_ERRORCODE);
                return resp;
            }
        }
        
        if (null != editConf && !StringUtils.isEmpty(editConf.getChairmanPassword()))
        {
            String encrytedChairmanPassword;
            try
            {
                // 加密方式向下兼容
                encrytedChairmanPassword = Encrypt.getEncryptPwd(editConf.getChairmanPassword());
                editConf.setChairmanPassword(encrytedChairmanPassword);
            }
            catch (Exception e)
            {
                LOGGER.error("encode ChairmanPassword error");
                resp.setResultCode(PlatformNativeConstant.SDK_TP_PASSWORD_ENCODE_ERRORCODE);
                return resp;
            }
        }
        
        EditScheduledConfExResponse editScheduledConfExResp;
        EditScheduledConfEx editScheduledConfEx = new EditScheduledConfEx();
        editScheduledConfEx.setEditConf(editConf);
        try
        {
            editScheduledConfExResp = TPProfessionalConfMgr.editScheduledConfEx(editScheduledConfEx);
        }
        catch (Exception e)
        {
            LOGGER.error("editScheduledConfEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = editScheduledConfExResp.getResultCode();
        resp.setResult(0 == resultCode ? editScheduledConfExResp.getConferenceInfo() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("editScheduledConfEx method end");
        return resp;
    }
    
    public TPSDKResponseEx<RecurrenceConfInfoEx> editRecurrenceConferenceEx(RecurrenceConfInfoEx editConf,
        Date beginTime)
    {
        LOGGER.info("editRecurrenceConferenceEx method start");
        TPSDKResponseEx<RecurrenceConfInfoEx> resp = new TPSDKResponseEx<RecurrenceConfInfoEx>();
        
        if (null != editConf && !StringUtils.isEmpty(editConf.getPassword()))
        {
            String encrytedPassword;
            try
            {
                // 加密方式向下兼容
                encrytedPassword = Encrypt.getEncryptPwd(editConf.getPassword());
                editConf.setPassword(encrytedPassword);
            }
            catch (Exception e)
            {
                LOGGER.error("encode password error");
                resp.setResultCode(PlatformNativeConstant.SDK_TP_PASSWORD_ENCODE_ERRORCODE);
                return resp;
            }
        }
        
        if (null != editConf && !StringUtils.isEmpty(editConf.getChairmanPassword()))
        {
            String encrytedChairmanPassword;
            try
            {
                // 加密方式向下兼容
                encrytedChairmanPassword = Encrypt.getEncryptPwd(editConf.getChairmanPassword());
                editConf.setChairmanPassword(encrytedChairmanPassword);
            }
            catch (Exception e)
            {
                LOGGER.error("encode ChairmanPassword error");
                resp.setResultCode(PlatformNativeConstant.SDK_TP_PASSWORD_ENCODE_ERRORCODE);
                return resp;
            }
        }
        
        EditRecurrenceConferenceExResponse editRecurrenceConferenceExResp;
        EditRecurrenceConferenceEx editRecurrenceConferenceEx = new EditRecurrenceConferenceEx();
        editRecurrenceConferenceEx.setEditConf(editConf);
        editRecurrenceConferenceEx.setBeginTime(beginTime);
        try
        {
            editRecurrenceConferenceExResp =
                TPProfessionalConfMgr.editRecurrenceConferenceEx(editRecurrenceConferenceEx);
        }
        catch (Exception e)
        {
            LOGGER.error("editRecurrenceConferenceEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = editRecurrenceConferenceExResp.getResultCode();
        resp.setResult(0 == resultCode ? editRecurrenceConferenceExResp.getRecurrenceConfInfo() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("editRecurrenceConferenceEx method end");
        return resp;
    }
    
    public TPSDKResponseEx<List<SiteInfoEx>> querySitesEx()
    {
        LOGGER.info("querySitesEx method start");
        TPSDKResponseEx<List<SiteInfoEx>> resp = new TPSDKResponseEx<List<SiteInfoEx>>();
        QuerySitesExResponse querySitesExResp;
        try
        {
            querySitesExResp = TPProfessionalConfMgr.querySitesEx(new QuerySitesEx());
        }
        catch (Exception e)
        {
            LOGGER.error("querySitesEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = querySitesExResp.getResultCode();
        resp.setResult(0 == resultCode ? querySitesExResp.getSiteInfos() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("querySitesEx method end");
        return resp;
    }
    
    public Integer prolongScheduledConfEx(String confId, Date beginDate, Duration prolongTime)
    {
        LOGGER.info("prolongScheduledConfEx method start");
        ProlongScheduledConfEx prolongScheduledConfEx = new ProlongScheduledConfEx();
        prolongScheduledConfEx.setBeginDate(beginDate);
        prolongScheduledConfEx.setConfId(confId);
        prolongScheduledConfEx.setProlongTime(prolongTime);
        try
        {
            Integer errorCode = TPProfessionalConfMgr.prolongScheduledConfEx(prolongScheduledConfEx).getResultCode();
            LOGGER.info("prolongScheduledConfEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("prolongScheduledConfEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public TPSDKResponseEx<Map<String, List<FreeBusyStateEx>>> querySiteStatusEx(List<String> siteUris, Date beginTime,
        Duration duration)
    {
        LOGGER.info("querySiteStatusEx method start");
        TPSDKResponseEx<Map<String, List<FreeBusyStateEx>>> resp =
            new TPSDKResponseEx<Map<String, List<FreeBusyStateEx>>>();
        QuerySiteStatusEx querySiteStatusEx = new QuerySiteStatusEx();
        QuerySiteStatusExResponse querySiteStatusExResp;
        querySiteStatusEx.setBeginTime(beginTime);
        querySiteStatusEx.setDuration(duration);
        querySiteStatusEx.getSiteUris().addAll(null == siteUris ? new ArrayList<String>() : siteUris);
        try
        {
            querySiteStatusExResp = TPProfessionalConfMgr.querySiteStatusEx(querySiteStatusEx);
        }
        catch (Exception e)
        {
            LOGGER.error("querySiteStatusEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = querySiteStatusExResp.getResultCode();
        resp.setResultCode(resultCode);
        if (0 == resultCode)
        {
            Map<String, List<FreeBusyStateEx>> map = new HashMap<String, List<FreeBusyStateEx>>();
            for (SiteFreeBusyStatesEx siteFreeBusyStatesEx : querySiteStatusExResp.getSiteFreeBusyStates())
            {
                map.put(siteFreeBusyStatesEx.getUri(), siteFreeBusyStatesEx.getStates());
            }
            resp.setResult(map);
        }
        LOGGER.info("querySiteStatusEx method end");
        return resp;
    }
    
    public TPSDKResponseEx<List<ConferenceStatusEx>> queryConferencesStatusEx(List<String> confIds)
    {
        LOGGER.info("queryConferencesStatusEx method start");
        TPSDKResponseEx<List<ConferenceStatusEx>> resp = new TPSDKResponseEx<List<ConferenceStatusEx>>();
        QueryConferencesStatusEx queryConferencesStatusEx = new QueryConferencesStatusEx();
        QueryConferencesStatusExResponse queryConferencesStatusExResp;
        queryConferencesStatusEx.getConfIds().addAll(null == confIds ? new ArrayList<String>() : confIds);
        try
        {
            queryConferencesStatusExResp = TPProfessionalConfMgr.queryConferencesStatusEx(queryConferencesStatusEx);
        }
        catch (Exception e)
        {
            LOGGER.error("queryConferencesStatusEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = queryConferencesStatusExResp.getResultCode();
        resp.setResult(0 == resultCode ? queryConferencesStatusExResp.getConferenceStatuses() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("queryConferencesStatusEx method end");
        return resp;
    }
    
    public TPSDKResponseEx<List<SiteStatusEx>> queryConfSitesStatusEx(String confId, List<String> siteUris)
    {
        LOGGER.info("queryConfSitesStatusEx method start");
        TPSDKResponseEx<List<SiteStatusEx>> resp = new TPSDKResponseEx<List<SiteStatusEx>>();
        QueryConfSitesStatusEx queryConfSitesStatusEx = new QueryConfSitesStatusEx();
        QueryConfSitesStatusExResponse queryConfSitesStatusExResp;
        queryConfSitesStatusEx.setConfId(confId);
        queryConfSitesStatusEx.getSiteUris().addAll(null == siteUris ? new ArrayList<String>() : siteUris);
        try
        {
            queryConfSitesStatusExResp = TPProfessionalConfMgr.queryConfSitesStatusEx(queryConfSitesStatusEx);
        }
        catch (Exception e)
        {
            LOGGER.error("queryConfSitesStatusEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = queryConfSitesStatusExResp.getResultCode();
        resp.setResult(0 == resultCode ? queryConfSitesStatusExResp.getSiteStatuses() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("queryConfSitesStatusEx method end");
        return resp;
    }
    
    public TPSDKResponseEx<Map<String, List<FreeBusyStateEx>>> synchSiteStatusEx(List<String> siteUris, Date beginTime,
        Duration duration)
    {
        LOGGER.info("synchSiteStatusEx method start");
        TPSDKResponseEx<Map<String, List<FreeBusyStateEx>>> resp =
            new TPSDKResponseEx<Map<String, List<FreeBusyStateEx>>>();
        SynchSiteStatusEx synchSiteStatusEx = new SynchSiteStatusEx();
        SynchSiteStatusExResponse synchSiteStatusExResponse;
        synchSiteStatusEx.setBeginTime(beginTime);
        synchSiteStatusEx.setDuration(duration);
        synchSiteStatusEx.getSiteUris().addAll(null == siteUris ? new ArrayList<String>() : siteUris);
        try
        {
            synchSiteStatusExResponse = TPProfessionalConfMgr.synchSiteStatusEx(synchSiteStatusEx);
        }
        catch (Exception e)
        {
            LOGGER.error("synchSiteStatusEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = synchSiteStatusExResponse.getResultCode();
        resp.setResultCode(resultCode);
        if (0 == resultCode)
        {
            Map<String, List<FreeBusyStateEx>> map = new HashMap<String, List<FreeBusyStateEx>>();
            for (SiteFreeBusyStatesEx siteFreeBusyStatesEx : synchSiteStatusExResponse.getSiteFreeBusyStates())
            {
                map.put(siteFreeBusyStatesEx.getUri(), siteFreeBusyStatesEx.getStates());
            }
            resp.setResult(map);
        }
        LOGGER.info("synchSiteStatusEx method end");
        return resp;
    }
    
    public TPSDKResponseEx<List<SiteAccessInfoEx>> addSiteToConfEx(String confId, SiteInfoEx siteInfo, Date beginTime)
    {
        LOGGER.info("addSiteToConfEx method start");
        TPSDKResponseEx<List<SiteAccessInfoEx>> resp = new TPSDKResponseEx<List<SiteAccessInfoEx>>();
        AddSiteToConfEx addSiteToConfEx = new AddSiteToConfEx();
        AddSiteToConfExResponse addSiteToConfExResp;
        addSiteToConfEx.setConfId(confId);
        addSiteToConfEx.setSiteInfo(siteInfo);
        addSiteToConfEx.setBeginTime(beginTime);
        try
        {
            addSiteToConfExResp = TPProfessionalConfMgr.addSiteToConfEx(addSiteToConfEx);
        }
        catch (Exception e)
        {
            LOGGER.error("addSiteToConfEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = addSiteToConfExResp.getResultCode();
        resp.setResult(0 == resultCode ? addSiteToConfExResp.getSiteAccessInfos() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("addSiteToConfEx method end");
        return resp;
    }
    
    public Integer delSiteFromConfEx(String confId, String siteUri, Date beginTime)
    {
        LOGGER.info("delSiteFromConfEx method start");
        DelSiteFromConfEx delSiteFromConfEx = new DelSiteFromConfEx();
        delSiteFromConfEx.setConfId(confId);
        delSiteFromConfEx.setSiteUri(siteUri);
        delSiteFromConfEx.setBeginTime(beginTime);
        try
        {
            Integer errorCode = TPProfessionalConfMgr.delSiteFromConfEx(delSiteFromConfEx).getResultCode();
            LOGGER.info("delSiteFromConfEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("delSiteFromConfEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer connectSitesEx(String confId, List<String> siteUris)
    {
        LOGGER.info("connectSitesEx method start");
        ConnectSitesEx connectSitesEx = new ConnectSitesEx();
        connectSitesEx.setConfId(confId);
        connectSitesEx.getSiteUris().addAll(null == siteUris ? new ArrayList<String>() : siteUris);
        try
        {
            Integer errorCode = TPProfessionalConfMgr.connectSitesEx(connectSitesEx).getResultCode();
            LOGGER.info("connectSitesEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("connectSitesEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer disconnectSitesEx(String confId, List<String> siteUris)
    {
        LOGGER.info("disconnectSitesEx method start");
        DisconnectSitesEx disconnectSitesEx = new DisconnectSitesEx();
        disconnectSitesEx.setConfId(confId);
        disconnectSitesEx.getSiteUris().addAll(null == siteUris ? new ArrayList<String>() : siteUris);
        try
        {
            Integer errorCode = TPProfessionalConfMgr.disconnectSitesEx(disconnectSitesEx).getResultCode();
            LOGGER.info("disconnectSitesEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("disconnectSitesEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer delScheduledConfEx(String confId, Date beginTime)
    {
        LOGGER.info("delScheduledConfEx method start");
        DelScheduledConfEx delScheduledConfEx = new DelScheduledConfEx();
        delScheduledConfEx.setConfId(confId);
        delScheduledConfEx.setBeginTime(beginTime);
        try
        {
            Integer errorCode = TPProfessionalConfMgr.delScheduledConfEx(delScheduledConfEx).getResultCode();
            LOGGER.info("delScheduledConfEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("delScheduledConfEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer setVideoSourceEx(String confId, String siteUri, String videoSourceUri, Integer isLock)
    {
        LOGGER.info("setVideoSourceEx method start");
        SetVideoSourceEx setVideoSourceEx = new SetVideoSourceEx();
        setVideoSourceEx.setConfId(confId);
        setVideoSourceEx.setIsLock(isLock);
        setVideoSourceEx.setSiteUri(siteUri);
        setVideoSourceEx.setVideoSourceUri(videoSourceUri);
        try
        {
            Integer errorCode = TPProfessionalConfCtr.setVideoSourceEx(setVideoSourceEx).getResultCode();
            LOGGER.info("setVideoSourceEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("setVideoSourceEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer setAudioSwitchEx(String confId, Integer switchGate, Integer isSwitch)
    {
        LOGGER.info("setAudioSwitchEx method start");
        SetAudioSwitchEx setAudioSwitchEx = new SetAudioSwitchEx();
        setAudioSwitchEx.setConfId(confId);
        setAudioSwitchEx.setIsSwitch(isSwitch);
        setAudioSwitchEx.setSwitchGate(switchGate);
        try
        {
            Integer errorCode = TPProfessionalConfCtr.setAudioSwitchEx(setAudioSwitchEx).getResultCode();
            LOGGER.info("setAudioSwitchEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("setAudioSwitchEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer setBroadcastSiteEx(String confId, String siteUri, Integer isBroadcast)
    {
        LOGGER.info("setBroadcastSiteEx method start");
        SetBroadcastSiteEx setBroadcastSiteEx = new SetBroadcastSiteEx();
        setBroadcastSiteEx.setConfId(confId);
        setBroadcastSiteEx.setIsBroadcast(isBroadcast);
        setBroadcastSiteEx.setSiteUri(siteUri);
        try
        {
            Integer errorCode = TPProfessionalConfCtr.setBroadcastSiteEx(setBroadcastSiteEx).getResultCode();
            LOGGER.info("setBroadcastSiteEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("setBroadcastSiteEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer setBroadcastContinuousPresenceEx(String confId, Integer isBroadcast)
    {
        LOGGER.info("setBroadcastContinuousPresenceEx method start");
        SetBroadcastContinuousPresenceEx setBroadcastContinuousPresenceEx = new SetBroadcastContinuousPresenceEx();
        setBroadcastContinuousPresenceEx.setConfId(confId);
        setBroadcastContinuousPresenceEx.setIsBroadcast(isBroadcast);
        try
        {
            Integer errorCode =
                TPProfessionalConfCtr.setBroadcastContinuousPresenceEx(setBroadcastContinuousPresenceEx)
                    .getResultCode();
            LOGGER.info("setBroadcastContinuousPresenceEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("setBroadcastContinuousPresenceEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer setSitesMuteEx(String confId, List<String> siteUris, Integer isMute)
    {
        LOGGER.info("setSitesMuteEx method start");
        SetSitesMuteEx setSitesMuteEx = new SetSitesMuteEx();
        setSitesMuteEx.setConfId(confId);
        setSitesMuteEx.setIsMute(isMute);
        setSitesMuteEx.getSiteUris().addAll(null == siteUris ? new ArrayList<String>() : siteUris);
        try
        {
            Integer errorCode = TPProfessionalConfCtr.setSitesMuteEx(setSitesMuteEx).getResultCode();
            LOGGER.info("setSitesMuteEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("setSitesMuteEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer setSitesQuietEx(String confId, List<String> siteUris, Integer isQuiet)
    {
        LOGGER.info("setSitesQuietEx method start");
        SetSitesQuietEx setSitesQuietEx = new SetSitesQuietEx();
        setSitesQuietEx.setConfId(confId);
        setSitesQuietEx.setIsQuiet(isQuiet);
        setSitesQuietEx.getSiteUris().addAll(null == siteUris ? new ArrayList<String>() : siteUris);
        try
        {
            Integer errorCode = TPProfessionalConfCtr.setSitesQuietEx(setSitesQuietEx).getResultCode();
            LOGGER.info("setSitesQuietEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("setSitesQuietEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer setContinuousPresenceEx(String confId, String target, Integer presenceMode, List<String> subPics)
    {
        LOGGER.info("setContinuousPresenceEx method start");
        SetContinuousPresenceEx setContinuousPresenceEx = new SetContinuousPresenceEx();
        setContinuousPresenceEx.setConfId(confId);
        setContinuousPresenceEx.setTarget(target);
        setContinuousPresenceEx.setPresenceMode(presenceMode);
        setContinuousPresenceEx.getSubPics().addAll(null == subPics ? new ArrayList<String>() : subPics);
        try
        {
            Integer errorCode = TPProfessionalConfCtr.setContinuousPresenceEx(setContinuousPresenceEx).getResultCode();
            LOGGER.info("setContinuousPresenceEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("setContinuousPresenceEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer requestConfChairEx(String confId, String siteURI)
    {
        LOGGER.info("requestConfChairEx method start");
        RequestConfChairEx requestChairEx = new RequestConfChairEx();
        requestChairEx.setConfId(confId);
        requestChairEx.setChairmanUri(siteURI);
        try
        {
            Integer errorCode = TPProfessionalConfCtr.requestConfChairEx(requestChairEx).getResultCode();
            LOGGER.info("requestConfChairEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("requestConfChairEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer releaseConfChairEx(String value)
    {
        LOGGER.info("releaseConfChairEx method start");
        ReleaseConfChairEx releaseChairEx = new ReleaseConfChairEx();
        releaseChairEx.setConfId(value);
        try
        {
            Integer errorCode = TPProfessionalConfCtr.releaseConfChairEx(releaseChairEx).getResultCode();
            LOGGER.info("releaseConfChairEx method end");
            return errorCode;
        }
        catch (Exception e)
        {
            LOGGER.error("releaseConfChairEx method error", e);
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer setFloorEx(String confId, String siteUri)
    {
        LOGGER.info("setFloorEx method start");
        SetFloorEx setFloorEx = new SetFloorEx();
        setFloorEx.setConfId(confId);
        setFloorEx.setSiteUri(siteUri);
        try
        {
            SetFloorExResponse result = TPProfessionalConfCtr.setFloorEx(setFloorEx);
            Integer resultCode = result.getResultCode();
            LOGGER.info("setFloorEx method end");
            return resultCode;
        }
        catch (Exception e)
        {
            LOGGER.error("setFloorEx method exception");
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer setConfSiteVolumeEx(String confId, List<SiteVolumeEx> siteVolumes)
    {
        LOGGER.info("setConfSiteVolumeEx method start");
        SetConfSiteVolumeEx setConfSiteVolumeEx = new SetConfSiteVolumeEx();
        setConfSiteVolumeEx.setConfId(confId);
        List<SiteVolumeEx> siteVolumeExs = setConfSiteVolumeEx.getSiteVolumes();
        if (null != siteVolumes)
        {
            siteVolumeExs.addAll(siteVolumes);
        }
        try
        {
            SetConfSiteVolumeExResponse result = TPProfessionalConfCtr.setConfSiteVolumeEx(setConfSiteVolumeEx);
            Integer resultCode = result.getResultCode();
            LOGGER.info("setConfSiteVolumeEx method end");
            return resultCode;
        }
        catch (Exception e)
        {
            LOGGER.error("setConfSiteVolumeEx method exception");
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer displayConfSiteLocalVideoEx(String confId, List<String> siteUris)
    {
        LOGGER.info("displayConfSiteLocalVideoEx method start");
        DisplayConfSiteLocalVideoEx displayConfSiteLocalVideoEx = new DisplayConfSiteLocalVideoEx();
        displayConfSiteLocalVideoEx.setConfId(confId);
        List<String> siteUriExs = displayConfSiteLocalVideoEx.getSiteUris();
        if (null != siteUris)
        {
            siteUriExs.addAll(siteUris);
        }
        try
        {
            DisplayConfSiteLocalVideoExResponse result =
                TPProfessionalConfCtr.displayConfSiteLocalVideoEx(displayConfSiteLocalVideoEx);
            Integer resultCode = result.getResultCode();
            LOGGER.info("displayConfSiteLocalVideoEx method end");
            return resultCode;
        }
        catch (Exception e)
        {
            LOGGER.error("displayConfSiteLocalVideoEx method exception");
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer hideConfSiteLocalVideoEx(String confId, List<String> siteUris)
    {
        LOGGER.info("hideConfSiteLocalVideoEx method start");
        HideConfSiteLocalVideoEx hideConfSiteLocalVideoEx = new HideConfSiteLocalVideoEx();
        hideConfSiteLocalVideoEx.setConfId(confId);
        List<String> siteUriExs = hideConfSiteLocalVideoEx.getSiteUris();
        if (null != siteUris)
        {
            siteUriExs.addAll(siteUris);
        }
        try
        {
            HideConfSiteLocalVideoExResponse result =
                TPProfessionalConfCtr.hideConfSiteLocalVideoEx(hideConfSiteLocalVideoEx);
            Integer resultCode = result.getResultCode();
            LOGGER.info("hideConfSiteLocalVideoEx method end");
            return resultCode;
        }
        catch (Exception e)
        {
            LOGGER.error("hideConfSiteLocalVideoEx method exception");
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    @Override
    public TPSDKResponseWithPageEx<List<PointToPointCDREx>> queryPointToPointCDREx(PointToPointCDRQueryConfigEx param)
    {
        LOGGER.info("queryPointToPointCDREx method start");
        TPSDKResponseWithPageEx<List<PointToPointCDREx>> resp = new TPSDKResponseWithPageEx<List<PointToPointCDREx>>();
        QueryPointToPointCDRExResponse response = null;
        try
        {
            QueryPointToPointCDREx parameters = new QueryPointToPointCDREx();
            parameters.setQueryConfig(param);
            response = TPProfessionalConfMgr.queryPointToPointCDREx(parameters);
        }
        catch (Exception e)
        {
            LOGGER.error("queryPointToPointCDREx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = response.getResultCode();
        resp.setResult(0 == resultCode ? response.getCdr() : null);
        resp.setPageInfo(0 == resultCode ? response.getPageInfo() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("queryPointToPointCDREx method end");
        return resp;
    }
    
    @Override
    public TPSDKResponseEx<List<AdhocConfFreeBusyStateEx>> synchAdhocConfFreeBusyEx(Date beginTime, Duration duration,
        List<String> accessCodes)
    {
        LOGGER.info("synchAdhocConfFreeBusyEx method start");
        TPSDKResponseEx<List<AdhocConfFreeBusyStateEx>> resp = new TPSDKResponseEx<List<AdhocConfFreeBusyStateEx>>();
        SynchAdhocConfFreeBusyExResponse response = null;
        try
        {
            SynchAdhocConfFreeBusyEx parameters = new SynchAdhocConfFreeBusyEx();
            parameters.setBeginTime(beginTime);
            parameters.setDuration(duration);
            parameters.setConfAccessCodes(accessCodes);
            response = TPProfessionalConfMgr.synchAdhocConfFreeBusyEx(parameters);
        }
        catch (Exception e)
        {
            LOGGER.error("synchAdhocConfFreeBusyEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = response.getResultCode();
        resp.setResult(0 == resultCode ? response.getFreebusy() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("synchAdhocConfFreeBusyEx method end");
        return resp;
    }
    
    @Override
    public TPSDKResponseWithPageEx<List<AdhocConferenceEx>> queryAdhocConferencesEx(QueryConfigEx param)
    {
        LOGGER.info("queryAdhocConferencesEx method start");
        TPSDKResponseWithPageEx<List<AdhocConferenceEx>> resp = new TPSDKResponseWithPageEx<List<AdhocConferenceEx>>();
        QueryAdhocConferencesExResponse response = null;
        try
        {
            QueryAdhocConferencesEx parameters = new QueryAdhocConferencesEx();
            parameters.setQueryConfig(param);
            response = TPProfessionalConfMgr.queryAdhocConferencesEx(parameters);
        }
        catch (Exception e)
        {
            LOGGER.error("queryAdhocConferencesEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = response.getResultCode();
        resp.setResult(0 == resultCode ? response.getAdhocConferences() : null);
        resp.setPageInfo(0 == resultCode ? response.getPageInfo() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("queryAdhocConferencesEx method end");
        return resp;
    }
    
    @Override
    public TPSDKResponseEx<List<AdhocConfFreeBusyStateEx>> queryAdhocConfFreeBusyEx(Date beginTime, Duration duration,
        List<String> accessCodes)
    {
        LOGGER.info("queryAdhocConfFreeBusyEx method start");
        TPSDKResponseEx<List<AdhocConfFreeBusyStateEx>> resp = new TPSDKResponseEx<List<AdhocConfFreeBusyStateEx>>();
        QueryAdhocConfFreeBusyExResponse response = null;
        try
        {
            QueryAdhocConfFreeBusyEx parameters = new QueryAdhocConfFreeBusyEx();
            parameters.setBeginTime(beginTime);
            parameters.setDuration(duration);
            parameters.setConfAccessCodes(accessCodes);
            response = TPProfessionalConfMgr.queryAdhocConfFreeBusyEx(parameters);
        }
        catch (Exception e)
        {
            LOGGER.error("queryAdhocConfFreeBusyEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = response.getResultCode();
        resp.setResult(0 == resultCode ? response.getFreebusy() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("queryAdhocConfFreeBusyEx method end");
        return resp;
    }
    
    @Override
    public TPSDKResponseWithPageEx<List<MultiPointCDREx>> queryMultiPointCDREx(MultiPointCDRQueryConfigEx param)
    {
        LOGGER.info("queryMultiPointCDREx method start");
        TPSDKResponseWithPageEx<List<MultiPointCDREx>> resp = new TPSDKResponseWithPageEx<List<MultiPointCDREx>>();
        QueryMultiPointCDRExResponse response = null;
        try
        {
            QueryMultiPointCDREx parameters = new QueryMultiPointCDREx();
            parameters.setQueryConfig(param);
            response = TPProfessionalConfMgr.queryMultiPointCDREx(parameters);
        }
        catch (Exception e)
        {
            LOGGER.error("queryMultiPointCDREx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = response.getResultCode();
        resp.setResult(0 == resultCode ? response.getCdr() : null);
        resp.setPageInfo(0 == resultCode ? response.getPageInfo() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("queryMultiPointCDREx method end");
        return resp;
    }
    
    public Integer lockPresentationEx(String confId, String siteUri)
    {
        LOGGER.info("lockPresentationEx method start");
        LockPresentationEx parameters = new LockPresentationEx();
        parameters.setConfId(confId);
        parameters.setSiteUri(siteUri);
        try
        {
            LockPresentationExResponse result = TPProfessionalConfCtr.lockPresentationEx(parameters);
            Integer resultCode = result.getResultCode();
            LOGGER.info("lockPresentationEx method end");
            return resultCode;
        }
        catch (Exception e)
        {
            LOGGER.error("lockPresentationEx method exception");
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public Integer unlockPresentationEx(String confId)
    {
        LOGGER.info("unlockPresentationEx method start");
        UnlockPresentationEx parameters = new UnlockPresentationEx();
        parameters.setConfId(confId);
        try
        {
            UnlockPresentationExResponse result = TPProfessionalConfCtr.unlockPresentationEx(parameters);
            Integer resultCode = result.getResultCode();
            LOGGER.info("unlockPresentationEx method end");
            return resultCode;
        }
        catch (Exception e)
        {
            LOGGER.error("unlockPresentationEx method exception");
            return ExceptionUtils.processSoapException(e);
        }
    }
    
    public TPSDKResponseEx<List<SiteMCUEx>> queryConfSiteMCUEx(String confId, List<String> siteUris, Date beginTime)
    {
        LOGGER.info("queryConfSiteMCUEx method start");
        TPSDKResponseEx<List<SiteMCUEx>> resp = new TPSDKResponseEx<List<SiteMCUEx>>();
        QueryConfSiteMCUExResponse response = null;
        try
        {
            QueryConfSiteMCUEx parameters = new QueryConfSiteMCUEx();
            parameters.setConfId(confId);
            parameters.setSiteUris(siteUris);
            parameters.setBeginTime(beginTime);
            
            response = TPProfessionalConfMgr.queryConfSiteMCUEx(parameters);
        }
        catch (Exception e)
        {
            LOGGER.error("queryConfSiteMCUEx method exception");
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = response.getResultCode();
        resp.setResult(0 == resultCode ? response.getMcus() : null);
        resp.setResultCode(resultCode);
        LOGGER.info("queryConfSiteMCUEx method end");
        return resp;
    }
    
    @Override
    public TPSDKResponseEx<GetContinuousPresenceInfoExResult> getContinuousPresenceInfoEx(String confId)
    {
        LOGGER.info("getContinuousPresenceInfoEx method start");
        TPSDKResponseEx<GetContinuousPresenceInfoExResult> resp =
            new TPSDKResponseEx<GetContinuousPresenceInfoExResult>();
        GetContinuousPresenceInfoExResponse response = null;
        try
        {
            GetContinuousPresenceInfoEx parameters = new GetContinuousPresenceInfoEx();
            parameters.setConfId(confId);
            response = TPProfessionalConfMgr.getContinuousPresenceInfoEx(parameters);
        }
        catch (Exception e)
        {
            LOGGER.error("getContinuousPresenceInfoEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = response.getResultCode();
        if (0 == resultCode)
        {
            GetContinuousPresenceInfoExResult resultData = new GetContinuousPresenceInfoExResult();
            resultData.setCpResource(response.getCpResource());
            resultData.setSupportCPModes(response.getSupportCPModes());
            resultData.setTargets(response.getTargets());
            resp.setResult(resultData);
        }
        resp.setResultCode(resultCode);
        LOGGER.info("getContinuousPresenceInfoEx method end");
        return resp;
    }
    
    @Override
    public TPSDKResponseEx<GetContinuousPresenceParamExResult> getContinuousPresenceParamEx(String confId, String target)
    {
        LOGGER.info("getContinuousPresenceParamEx method start");
        TPSDKResponseEx<GetContinuousPresenceParamExResult> resp =
            new TPSDKResponseEx<GetContinuousPresenceParamExResult>();
        GetContinuousPresenceParamExResponse response = null;
        try
        {
            GetContinuousPresenceParamEx parameters = new GetContinuousPresenceParamEx();
            parameters.setConfId(confId);
            parameters.setTarget(target);
            response = TPProfessionalConfMgr.getContinuousPresenceParamEx(parameters);
        }
        catch (Exception e)
        {
            LOGGER.error("getContinuousPresenceParamEx method error", e);
            ExceptionUtils.processSoapException(resp, e);
            return resp;
        }
        Integer resultCode = response.getResultCode();
        if (0 == resultCode)
        {
            GetContinuousPresenceParamExResult resultData = new GetContinuousPresenceParamExResult();
            resultData.setPresenceMode(response.getPresenceMode());
            resultData.setSubPics(response.getSubPics());
            resp.setResult(resultData);
        }
        resp.setResultCode(resultCode);
        LOGGER.info("getContinuousPresenceParamEx method end");
        return resp;
    }
}
